import request from '../utils/request'
// 文章列表
export function getArticlesList(params) {
  return request({
    url: '/articles',
    params
  })
}

// 文章删除
export function delArticles(id) {
  return request({
    url: '/articles/' + id,
    method: 'DELETE'
  })
}

// 文章状态
export function stateArticles(id, state) {
  return request({
    url: '/articles/' + id + '/' + state,

    method: 'POST'
  })
}

// 文章新增
export function addArticles(data) {
  return request({
    url: '/articles',
    method: 'POST',
    data
  })
}
// 文章编辑
export function editArticles(data) {
  return request({
    url: '/articles/' + data.id,
    method: 'PUT',
    data
  })
}
